See stationmap.R (lots of packages there’s no need to call for the other figures).
For this I use the package DiagrammR, intending to show how the different data types flow into each other for assessment.
##Figure 2: map The bathymetry file is too large to include in this repo, and the mapping packages are somewhat specific, but let me know if you’d like it and I will send you the relevant files and code!
Figure 3 represents combined time series of Alexandrium 18s, saxitoxin, Pseudo-nitzschia 18s, domoic acid, and chl-a concentration, for general time series view of the data
Figure S2 shows how toxin concentrations vary by season
Figure 4 compares toxin concentration to qPCR counts/mL of matched peterson stations
## Estimating learning rate. Each dot corresponds to a loss evaluation.
## qu = 0.75........done
## Estimating learning rate. Each dot corresponds to a loss evaluation.
## qu = 0.9........done
Figure 6 compares toxin concentration to 18S of matched peterson stations. It proceeds to bootstrap 1000x, and extracts the 95th and 5th percentiles of at each chlorophyll value from the bootstrapped CPAs to represent the confidence interval
##small version of plot for visual abstract
This section takes a subset of taxa from the previous plot and then creates a combined CPA, in this case looking at the likelihood of Dinophysis OR Alexandrium or Heterosigma exceeding their respective threshold relative abundances. I also include a couple methods of identifying inflections in the data: one is a changepoint analysis using the EnvCPT package, using a technique similar to ARIMA to identify inflections. The other is a GAM fit to the CPA data, then isolating the instantaneous change of the GAM function using a function called “derivatives” from the gratia package. It allows us to see what parts of the distribution are associated with greater change in likelihood.
## | | | 0% | |====== | 8% | |============ | 17% | |================== | 25% | |======================= | 33% | |============================= | 42% | |=================================== | 50% | |========================================= | 58% | |=============================================== | 67% | |==================================================== | 75% | |========================================================== | 83% | |================================================================ | 92% | |======================================================================| 100%
## | | | 0% | |====== | 8% | |============ | 17%Error in arima(data, order = c(1, 0, 0), method = "CSS-ML") :
## non-stationary AR part from CSS
## | |================== | 25%Error in arima(data, order = c(2, 0, 0), method = "CSS-ML") :
## non-stationary AR part from CSS
## | |======================= | 33% | |============================= | 42% | |=================================== | 50% | |========================================= | 58% | |=============================================== | 67% | |==================================================== | 75% | |========================================================== | 83% | |================================================================ | 92% | |======================================================================| 100%
## | | | 0% | |====== | 8% | |============ | 17% | |================== | 25% | |======================= | 33% | |============================= | 42% | |=================================== | 50% | |========================================= | 58% | |=============================================== | 67% | |==================================================== | 75% | |========================================================== | 83% | |================================================================ | 92% | |======================================================================| 100%
## | | | 0% | |====== | 8% | |============ | 17% | |================== | 25% | |======================= | 33% | |============================= | 42% | |=================================== | 50% | |========================================= | 58% | |=============================================== | 67% | |==================================================== | 75% | |========================================================== | 83% | |================================================================ | 92% | |======================================================================| 100%
## | | | 0% | |====== | 8% | |============ | 17%Error in arima(data, order = c(1, 0, 0), method = "CSS-ML") :
## non-stationary AR part from CSS
## | |================== | 25%Error in arima(data, order = c(2, 0, 0), method = "CSS-ML") :
## non-stationary AR part from CSS
## | |======================= | 33% | |============================= | 42% | |=================================== | 50% | |========================================= | 58% | |=============================================== | 67% | |==================================================== | 75% | |========================================================== | 83% | |================================================================ | 92% | |======================================================================| 100%
## | | | 0% | |====== | 8% | |============ | 17%Error in arima(data, order = c(1, 0, 0), method = "CSS-ML") :
## non-stationary AR part from CSS
## | |================== | 25%Error in arima(data, order = c(2, 0, 0), method = "CSS-ML") :
## non-stationary AR part from CSS
## | |======================= | 33% | |============================= | 42% | |=================================== | 50% | |========================================= | 58% | |=============================================== | 67% | |==================================================== | 75% | |========================================================== | 83% | |================================================================ | 92% | |======================================================================| 100%
## | | | 0% | |====== | 8% | |============ | 17%Error in arima(data, order = c(1, 0, 0), method = "CSS-ML") :
## non-stationary AR part from CSS
## | |================== | 25% | |======================= | 33% | |============================= | 42% | |=================================== | 50% | |========================================= | 58% | |=============================================== | 67% | |==================================================== | 75% | |========================================================== | 83% | |================================================================ | 92% | |======================================================================| 100%
## | | | 0% | |====== | 8% | |============ | 17%Error in arima(data, order = c(1, 0, 0), method = "CSS-ML") :
## non-stationary AR part from CSS
## | |================== | 25%Error in arima(data, order = c(2, 0, 0), method = "CSS-ML") :
## non-stationary AR part from CSS
## | |======================= | 33% | |============================= | 42% | |=================================== | 50% | |========================================= | 58% | |=============================================== | 67% | |==================================================== | 75% | |========================================================== | 83% | |================================================================ | 92% | |======================================================================| 100%